import service from "@/utils/request";
const DEPT_BASE_URL = "/api/";

class vendor {
  //部门列表
  static getDepartList(queryParams?: getDepart) {
    return service<any, getDepart>({
      url: `${DEPT_BASE_URL}DepartMent/DepartMnetList`,
      method: "post",
      data: queryParams,
    });
  }

  //删除部门
  static DeleteDepart(departId: number[]) {
    return service<any, any>({
      url: `${DEPT_BASE_URL}DepartMent/DeleteDepart`,
      method: "post",
      data: departId,
    });
  }

  static SheepType() {
    return service({
      url: `${DEPT_BASE_URL}DepartMent/GetDepartMent`,
      method: "post",
    });
  }
  //树形
  static MenuList() {
    return service({
      url: `${DEPT_BASE_URL}DepartMent/MenuList?pid=0`,
      method: "get",
    });
  }

  //部门添加
  static DepartAdd(data: any) {
    return service({
      url: `${DEPT_BASE_URL}DepartMent/AddDepart`,
      method: "post",
      data,
    });
  }
}

export default vendor;

export interface getDepart {
  pageIndex: number;
  pageSize: number;
  departId: number;
  departName: string;
  departTypeId: number;
  departState: number;
}

export interface AddDepart {
  departId: number;
  departName: string;
  departTypeId: number;
  departLevel: number;
  departState: number;
  pid: number;
  createName: string;
  createTime: Date;
  updateName: string;
  updateTime: Date;
  isdelete: 0;
}
